import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileByteWriter {
    public static void main(String[] args) {
        try {
            FileOutputStream outputStream = new FileOutputStream("stream_write.txt");
            outputStream.write('a');

            byte[] temp = {'b','c','d'};
            outputStream.write(temp);
            outputStream.write('\n');
            outputStream.write(temp, 1,2);

            outputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
